package edu.wuster.blog.service.impl;

import edu.wuster.blog.entity.Report;
import edu.wuster.blog.mapper.ReportMapper;
import edu.wuster.blog.service.ReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.List;


@Service
@Slf4j
public class ReportServiceImpl implements ReportService {

    @Autowired
    ReportMapper reportMapper;

    @Override
    public List<Report> select() {
        return reportMapper.select();
    }

    @Override
    public void addReport(Report report) {
        report.setCreateTime(LocalDateTime.now());
        reportMapper.addReport(report);
    }

    @Override
    public void deleteById(Integer id) {
        reportMapper.deleteById(id);
    }
}
